package com.nexus.all.manager;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nexus.all.dao.CommentMapper;
import com.nexus.all.dto.CommentQueryDTO;
import com.nexus.all.model.Comment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class CommentManager extends ServiceImpl<CommentMapper, Comment> {

    /**
     * 分页查询评论
     *
     * @param dto
     * @return
     */
    public Page<Comment> queryComment(CommentQueryDTO dto) {
        Page<Comment> page = new Page<>();
        page.setCurrent(dto.getPageNo());
        page.setSize(dto.getPageSize());
        return baseMapper.queryComment(dto, page);
    }
}
